import os
from database.app import Base
from operation.word_operation import wordOpt
from operation.word_spotcheck import wordSck
from operation.word_search import wordSearch


def show():
    print("提示：获取单词库成功")
    print(r"提示：任何想中断的操作，均可输入'exit'")
    print("1.操作单词")
    print("2.抽查单词")
    print("3.查找单词")
    print("4.退出程序")



# Create Base
base = Base(os.path.join(os.getcwd(), './database', 'word.db'))
os.system("clear")

show()
while True:
    ipt = input("请输入序号：")
    if ipt == "1":
        wordOpt(base)
        os.system("clear")
        show()
    elif ipt == "2":
        wordSck(base)
        os.system("clear")
        show()

    elif ipt == "3":
        wordSearch(base)
        os.system("clear")
        show()
    elif ipt == "4" or ipt == 'exit':
        os.system("clear")
        print("提示：再见")
        break
    else:
        print('错误：没有此方法')
        continue